package org.pvt.gui;

import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;

import static org.pvt.gui.UIUtils.onMainMenuOptionSelected;
import static org.pvt.gui.UIUtils.setUpMainMenu;

/**
 * @author Pavel Talanov
 */
public abstract class ActivityWithMainMenu extends Activity {

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        setUpMainMenu(menu, this);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        onMainMenuOptionSelected(item, this);
        return super.onOptionsItemSelected(item);
    }
}
